package com.netbao.fin.controller;




import com.netbao.fin.model.Total;
import com.netbao.fin.service.ShenService;
import com.netbao.model.PageBean;
import com.netbao.model.PageResult;
import com.netbao.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.ParseException;

/**
 * @author suqk
 * @create 2019-11-03 14:57
 */
@Controller
@RequestMapping("fin/shen")
public class ShenController {

    @Autowired
    private ShenService shenService;
    @GetMapping("/page")
//    @RequiresPermissions("fin:shen:manage")
    public String toPage(){
        return "fin/shen";
    }
    @GetMapping("/listAll")
    @ResponseBody
    public PageResult listAll(PageBean pageBean, String name){
        return shenService.listAll(pageBean,name);
    }
    @PostMapping("/save")
    @ResponseBody
    public Result save(Total total) throws ParseException {
        return shenService.saveSubtotal(total);
    }
    @PostMapping("/tong")
    @ResponseBody
    public Result tong(Long id,Long opid) throws ParseException {
        return shenService.tong(id,opid);
    }


}
